# -*- coding: utf-8 -*-
"""

"""
import pandas as pd


# ===========================================
# class Road
# ===========================================
class Road:
    def __init__(self, road_id, length, road_from, road_to):
        self.road_id = road_id
        self.length = length
        self.road_from = road_from
        self.road_to = road_to


# ===========================================
# class Car
# ===========================================
class Car:
    def __init__(self, car_id, car_from, car_to, car_speed, car_plantime):
        self.car_id = car_id
        self.car_from = car_from
        self.car_to = car_to
        self.car_speed = car_speed
        self.car_planetime = car_plantime


# ===========================================
# class Cross
# ===========================================
class Cross:
    def __init__(self, cross_id, road_id1, road_id2, road_id3, road_id4):
        self.cross_id = cross_id
        self.road_id1 = road_id1
        self.road_id2 = road_id2
        self.road_id3 = road_id3
        self.road_id4 = road_id4


# ===========================================
# class Graph
# ===========================================
def Graph:
    def __init__(self, road):


# ===========================================
# load data
# ===========================================
def load_data(file_path, obj):
    data = pd.read_csv(file_path + '/' + obj + '.txt')
    if obj is 'cross':
        data.columns = ['id', 'up', 'right', 'down', 'left']
    else:
        data.columns = data.columns.str.strip('#?(?)?')
    data[data.columns[0]] = data[data.columns[0]].str.lstrip('(')
    data[data.columns[data.columns.size - 1]] = data[data.columns[data.columns.size - 1]].str.rstrip(')')
    return data


# ===========================================
# load data
# ===========================================

# ===========================================
# load data
# ===========================================
if __name__ == '__main__':
    file_path = '/Users/ymb_mac/Documents/Code/Python/SDK_python/CodeCraft-2019/config'
    obj_road = 'road'
    obj_cross = 'cross'
    obj_car = 'car'
    Roads = load_data(file_path, obj_road)
    Cross = load_data(file_path, obj_cross)
    Cars = load_data(file_path, obj_car)